<?php

namespace App\Domain\ChannelBusiness\Requests;

use Illuminate\Foundation\Http\FormRequest;

class createChannelPost extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'type' => 'required',
            'phone'=> '',
            'contacts' => 'required',
            'address' => 'required',
            'term_start' => 'required',
            'term_end' => 'required',
            'status' => '',
            'salesman' => 'required',
            'province' => '',
            'city' => '',
            'area' =>'',
            'account' => '',
            'is_open' =>'required'
        ];
    }

    public function messages()
    {
        return [
            'account.required' => '账号必填',
            'name.required' => '渠道商名称必填',
            'type.required' => '渠道商类型必填',
            'salesman.required' => '业务员必填',
            'contacts.required' => '联系人必填',
            'address.required' => '渠道商地址必填',
            'term_start.required' => '合作开始期限必填',
            'term_end.required' => '合作结束期限必填',
            'is_open.required' => '是否开启渠道商账号必选',
        ];
    }
}
